<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- ios.qdoc -->
  <title>Qt for iOS | Qt 5.14</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="index.html">Qt 5.14</a></td><td >Qt for iOS</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.14.2 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#supported-configurations">Supported Configurations</a></li>
<li class="level1"><a href="#getting-started">Getting Started</a></li>
<li class="level2"><a href="#setting-up-the-development-environment">Setting Up the Development Environment</a></li>
<li class="level2"><a href="#building-applications-from-the-command-line">Building Applications From the Command Line</a></li>
<li class="level2"><a href="#building-applications-with-qt-creator">Building Applications with Qt Creator</a></li>
<li class="level1"><a href="#using-objective-c-code-in-qt-applications">Using Objective-C Code in Qt Applications</a></li>
<li class="level1"><a href="#examples-for-ios">Examples for iOS</a></li>
<li class="level1"><a href="#related-topics">Related Topics</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Qt for iOS</h1>
<span class="subtitle"></span>
<!-- $$$ios.html-description -->
<div class="descr"> <a name="details"></a>
<p>Qt's iOS port allows you to run Qt applications on iOS devices, such as iPhones, iPads, and iPod Touches.</p>
<a name="ios-supported-configurations"></a><a name="supported-configurations"></a>
<h2 id="supported-configurations">Supported Configurations</h2>
<p>The following configurations are supported.</p>
<div class="table"><table class="generic" width="80%">
 <thead><tr class="qt-style"><th >Target Platform</th><th >Architecture</th><th >Build Environment</th><th >Notes</th></tr></thead>
<tr valign="top" class="odd"><td >iOS 12, <b>iOS 13</b></td><td ><code>armv8</code> (<code>arm64</code>)</td><td ><b>Xcode 11</b> (iOS 13 SDK)</td><td ></td></tr>
<tr valign="top" class="even"><td >tvOS 12, <b>tvOS 13</b></td><td ><code>armv8</code> (<code>arm64</code>)</td><td ><b>Xcode 11</b> (tvOS 13 SDK)</td><td >Technology Preview</td></tr>
<tr valign="top" class="odd"><td >watchOS 5, <b>watchOS 6</b></td><td ><code>armv7k</code></td><td ><b>Xcode 11</b> (watchOS 6 SDK)</td><td >Technology Preview. No UI.</td></tr>
</table></div>
<a name="getting-started"></a>
<h2 id="getting-started">Getting Started</h2>
<p>Development and deployment is done using Xcode. The supported workflow is to maintain a <code>.pro</code> file based project, which generates an Xcode project. Building and deploying can be done using either Xcode or Qt Creator. We will look at that in more detail in the next section.</p>
<p>The minimum deployment target for Qt applications is specified in <a href="supported-platforms.html">Supported Platforms</a>.</p>
<a name="setting-up-the-development-environment"></a>
<h3 id="setting-up-the-development-environment">Setting Up the Development Environment</h3>
<p>You can download the Qt 5 installers from the <a href="http://qt.io/download">Downloads</a> page. For more information, see <a href="gettingstarted.html">Getting Started with Qt</a>.</p>
<p>Before installing Qt, you first need to install Xcode. You will find it in the Mac App Store <a href="http://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12">here</a>.</p>
<p><b>Note: </b>As recommended by Apple, you should always use the latest Xcode version when building your applications for the App Store. In practice this means you also need the latest version of macOS to develop apps with Qt, due to Xcode's system requirements.</p><p>For running Qt applications on your Mac or in the simulator that comes with Xcode, this is all you need. However, for running applications on a mobile device and/or publishing your applications in the App Store, you must join the <a href="https://developer.apple.com/programs/">Apple Developer Program</a>, and set up developer certificates and provisioning profiles. The easiest solution is to use a profile that takes any App ID (a <code>*</code>).</p>
<p>Before building any Qt applications, you should test that Xcode is set up correctly, for example, by running one of the standard Xcode application templates on your device.</p>
<a name="building-applications-from-the-command-line"></a>
<h3 id="building-applications-from-the-command-line">Building Applications From the Command Line</h3>
<p>As mentioned previously, the development workflow consists of maintaining a normal <code>.pro</code> file project and exporting it to Xcode.</p>
<p>Here is how to build a project with Xcode:</p>
<ul>
<li>run qmake (if you have not done so previously)</li>
<li>open the resulting <code>.xcodeproj</code> file in Xcode</li>
<li>build the application in Xcode</li>
</ul>
<p>Note that you must re-import the project if its setup changes, for example, when adding or removing source files.</p>
<a name="building-applications-with-qt-creator"></a>
<h3 id="building-applications-with-qt-creator">Building Applications with Qt Creator</h3>
<p>You can find information on how to set up and run Apple mobile device applications in Qt Creator's manual:</p>
<ul>
<li><a href="http://doc.qt.io/qtcreator/creator-developing-ios.html">Connecting Apple Mobile Devices</a>.</li>
</ul>
<p>As mentioned previously, you must have Xcode installed.</p>
<a name="using-objective-c-code-in-qt-applications"></a>
<h2 id="using-objective-c-code-in-qt-applications">Using Objective-C Code in Qt Applications</h2>
<p>Clang, the compiler used for applications on Apple Platforms, allows mixing C++ and Objective-C code. To enable this mode, suffix your source files with <code>.mm</code>, and add them to <code>OBJECTIVE_SOURCES</code> instead of <code>SOURCES</code> in the <code>.pro</code> file. This makes it possible to use frameworks from Apple's Developer Library in Qt applications. Most useful is perhaps the possibility for adding In-App Purchasing with the StoreKit framework.</p>
<a name="examples-for-ios"></a>
<h2 id="examples-for-ios">Examples for iOS</h2>
<p>In Qt Creator, tested examples on iOS can be looked up. Use the <code>ios</code> keyword to search for examples in the Qt Creator Welcome mode. Note that some examples may have limited functionality.</p>
<p>For a list of examples known to work on iOS devices, visit <a href="examples-ios.html">Qt for iOS Examples</a>.</p>
<a name="related-topics"></a>
<h2 id="related-topics">Related Topics</h2>
<p>The following topics provide more details about Qt for iOS:</p>
<ul>
<li><a href="porting-to-ios.html">Porting a Qt Quick Application</a></li>
<li><a href="ios-platform-notes.html">Platform Notes</a></li>
<li><a href="ios-building-from-source.html">Qt for iOS - Building from Source</a></li>
</ul>
</div>
<!-- @@@ios.html -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2020 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
